#include <iostream>
using namespace std;

/**
 * https://www.luogu.com.cn/problem/P1548
 */
int main(){
    int N, M;
    cin >> N >> M;


    int all = 0;
    int square = 0;
    for(int startX=0; startX<=N; startX++){
        for(int startY=0; startY<=M; startY++){
            
            for(int endX=0; endX<=N; endX++){
                for(int endY=0; endY<=M; endY++){
                    if(endX > startX && endY > startY){
                        all++;
                        if((endX - startX) == (endY - startY)){
                            square++;
                        }
                    }
                }
            }
        }
    }

    cout << square << " " << all - square;

    return 0;
}